﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Data.Common;
using System.Configuration;

namespace Core.Common
{
    public static class DataProvider
    {
        public static DbProviderFactory CreateProviderFactory(string connStr)
        {
            string providerConfig = connStr.Split(';').Single(c => c.StartsWith("provider="));
            string provideName = providerConfig.Split('=')[1];
            return DbProviderFactories.GetFactory(provideName);
        }
    }

}
